<?php

use think\facade\Route;

// 无需鉴权
Route::group(function () {
    // 选择角色组
    Route::get('auth/role/select', 'auth.role/select');
    // 选择菜单权限
    Route::get('auth/access/select', 'auth.access/select');

    // 管理员自己的通知消息
    Route::get('auth/admin/notifications', 'auth.Admin/notifications')->name('admin.auth.admin.notifications');
    Route::put('auth/admin/notification/:id', 'auth.Admin/notification')->name('admin.auth.admin.notification');
    Route::delete('auth/admin/notifications', 'auth.Admin/delNotifications')->name('admin.auth.admin.delNotifications');
    
    Route::group(function () {
        // 管理员和自己下级的日志
        Route::get('auth/adminLog', 'auth.AdminLog/list')->name('admin.auth.adminLog.list');

        Route::resource('auth/admin', 'auth.admin');
        Route::resource('auth/role', 'auth.role');
        Route::resource('auth/access', 'auth.access');
    })->middleware('check_rule', 'admin');
})->middleware('check_login', 'admin');


